package com.etime.perfectschool.service.impl;

import com.etime.perfectschool.mapper.ActiviesCommentsMapper;
import com.etime.perfectschool.pojo.ActiviesComments;
import com.etime.perfectschool.service.ActiviesCommentsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ActiviesCommentsServiceImpl implements ActiviesCommentsService {

    @Autowired
    private ActiviesCommentsMapper activiesCommentsMapper;

    @Override
    public List<ActiviesComments> getAllActiviesComments(int activityId) {
        return activiesCommentsMapper.getAllActiviesComments(activityId);
    }

    @Override
    public int addActiviesComments(ActiviesComments activiesComments) {
        return activiesCommentsMapper.insert(activiesComments);
    }

    @Override
    public int deleteActiviesComments(int activiesCommentsId) {
        return activiesCommentsMapper.deleteById(activiesCommentsId);
    }

    @Override
    public boolean deleteActiviesCommentsByactivityId(int activityId) {
        return activiesCommentsMapper.deleteActiviesCommentsByactivityId(activityId)==0?false:true;
    }
}
